﻿using System;

namespace Sencha.Serialization.Exceptions
{
	[Serializable]
	sealed class WrongTypeForAdHocSerialization : JsonSerializationException
	{
		public WrongTypeForAdHocSerialization(Type type, IJsonReader reader)
			: base(Loc.GetErrorString("Exception_WrongTypeForAdHocSerialization", type), ErrorCode.WrongTypeForAdHocSerialization, reader)
		{
			if (type == null)
				throw new ArgumentNullException("type");
			if (reader == null)
				throw new ArgumentNullException("reader");
			System.Diagnostics.Contracts.Contract.EndContractBlock();
		}
		public WrongTypeForAdHocSerialization(Type type, IJsonWriter writer)
			: base(Loc.GetErrorString("Exception_WrongTypeForAdHocSerialization", type), ErrorCode.WrongTypeForAdHocSerialization, writer)
		{
			if (type == null)
				throw new ArgumentNullException("type");
			if (writer == null)
				throw new ArgumentNullException("writer");
			System.Diagnostics.Contracts.Contract.EndContractBlock();
		}
		protected WrongTypeForAdHocSerialization(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
			: base(info, context)
		{
		}
	}
}
